<?php
namespace app\common\validate;

use think\Validate;

class UserValidate extends Validate
{
    // 验证规则
    protected $rule = [
        'password|密码' => 'require',
        'name|姓名'     => 'require',
    ];
    //验证场景
    protected $scene = [
        'login' => ['account'=>'require', 'password'],
        'reg' => [
            'username|用户名'=>'require',
            'password|密码'=>'require|confirm',
            're-password|确认密码'=>'require|confirm:password'
        ]
    ];
}